package com.example.leetcode.backtrace;

import com.example.leetcode.backtrace.common.BackTraceUtils;
import com.example.leetcode.tree.common.TreeNode;
import com.example.leetcode.tree.common.TreeUtils;

import java.util.List;

/**
 * Definition for a binary tree node.
 * public class TreeNode {
 * int val;
 * TreeNode left;
 * TreeNode right;
 * TreeNode() {}
 * TreeNode(int val) { this.val = val; }
 * TreeNode(int val, TreeNode left, TreeNode right) {
 * this.val = val;
 * this.left = left;
 * this.right = right;
 * }
 * }
 */
class Solution113 {
    public List<List<Integer>> pathSum(TreeNode root, int targetSum) {
        return BackTraceUtils.pathSum(root, targetSum);
    }
}

public class leetcode113 {
    public static void main(String[] args) {
        Solution113 solution113 = new Solution113();
        Integer[] root = {5, 4, 8, 11, null, 13, 4, 7, 2, null, null, 5, 1};
        System.out.println(solution113.pathSum(TreeUtils.generateLeetcodeTree(root), 22));
    }
}
